FROM python:3
WORKDIR /app

COPY ./code/requirements.txt .

# COPY ./code .

# RUN pip install --upgrade setuptools
# RUN python -m pip install --upgrade pip
# RUN pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/
RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

# COPY ./code/gun.conf .
# CMD gunicorn -b 0.0.0.0:9200 -k gevent -c gun.conf manage:app
CMD setsid gunicorn --worker-class=\gevent CityPlat.wsgi:application -b 0.0.0.0:9200 -w 2 --reload > logs/gunicorn.log 2>&1 &

# RUN python manage.py shell
# RUN from app import db
# RUN db.create_all()
# RUN exit()

# RUN python manage.py db init
# RUN python manage.py db migrate
# RUN python manage.py db upgrade